using System.Xml.Serialization;
using LinqToDB;
using LinqToDB.Mapping;
using NalogGarLoader.Data.Tables.GarEntries;

namespace NalogGarLoader.Data.Tables.GarEntries.AddressTables;

#nullable disable

[XmlRoot("NORMDOC")]
[Table(GarTypes.AS_NORMATIVE_DOCS)]
public class NormativeDoc : GarAddressTableEntryBase
{
    [XmlAttribute("ID")]
    [PrimaryKey]
    public long Id { get; set; }

    [XmlAttribute("NAME")]
    [Column (DataType = DataType.NText)]
    public string Name { get; set; }                         

    [XmlAttribute(AttributeName = "DATE", DataType = "date")]
    [Column(DataType = DataType.Date)]
    public DateTime Date { get; set; }        

    [XmlAttribute("NUMBER")]
    [Column (DataType = DataType.NVarChar, Length = 40)]
    public string Number { get; set; }

    [XmlAttribute("TYPE")]
    [Column (DataType = DataType.NVarChar, Length = 10)]
    public string Type { get; set; }     

    [XmlAttribute("KIND")]
    [Column (DataType = DataType.NVarChar, Length = 10)]
    public string Kind { get; set; }     

    [XmlAttribute(AttributeName = "UPDATEDATE", DataType = "date")]
    [Column(DataType = DataType.Date)]
    public DateTime UpdateDate { get; set; }  

    [XmlAttribute("ORGNAME")]
    [Column (DataType = DataType.NVarChar, Length = 500)]
    public string OrgName { get; set; }

    [XmlAttribute("REGNUM")]
    [Column (DataType = DataType.NVarChar, Length = 100)]
    public string RegNum { get; set; }  

    [XmlAttribute(AttributeName = "REGDATE", DataType = "date")]
    [Column(DataType = DataType.Date)]
    public DateTime RegDate { get; set; } 

    [XmlAttribute(AttributeName = "ACCDATE", DataType = "date")]
    [Column(DataType = DataType.Date)]
    public DateTime AccDate { get; set; }

    [XmlAttribute("COMMENT")]
    [Column(DataType = DataType.NText)]
    public string Comment { get; set; }       
}